*******************************************************************************
*******************REPLICATION FILE 3 - MULTIPLE COMPARISONS*******************
*****Kam, Cindy D. and John Sides. 
*****Body Politic: Disgust, Partisanship, and Public Opinion on Viral Outbreaks
*****Journal of Politics
*****This file recreates multiple comparisons estimates in Appendix D
*******************************************************************************

//Note: this code requires installation of Stata package "rwolf2"
//Note: this file can be computationally intensive, taking 2-6 hours to run
log using "2025-09-02 multiple comparisons.txt", text replace


* TABLE D1
set more off
use "Body_Politic_All_datasets.dta", clear
keep weight ebola* zika* concern* protect* fight* prevent* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]

tempname B_all /*matrix for collecting results*/

local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg ebola_concern `ivs')
       (svy: reg ebola_US `ivs') 
       (svy: reg ebola_AF `ivs') 
       (svy: reg ebola_UScit `ivs') 
       (svy: reg ebola_forcit `ivs'), reps(1000)  seed(2)
	   indepvars(disgust, disgust, disgust, disgust, disgust) 
;
#delimit cr

matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )

#delimit ;
rwolf2 (svy: reg zika_concern `ivs')
       (svy: reg zika_US `ivs') 
       (svy: reg zika_LA `ivs') 
       (svy: reg zika_UScit `ivs') 
       (svy: reg zika_forcit `ivs'), reps(1000)  seed(2)
	   indepvars(disgust, disgust, disgust, disgust, disgust) 
;
#delimit cr
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )

#delimit ;
rwolf2 (svy: reg concern_live_1 `ivs')
       (svy: reg protectAmer_1 `ivs') 
       (svy: reg fightabroad_1 `ivs') 
       (svy: reg prevent_UScit_1 `ivs') 
       (svy: reg prevent_forcit_1 `ivs') 
       (svy: reg concern_live_2 `ivs')
       (svy: reg protectAmer_2 `ivs') 
       (svy: reg fightabroad_2 `ivs') 
       (svy: reg prevent_UScit_2 `ivs') 
       (svy: reg prevent_forcit_2 `ivs') 
       (svy: reg concern_live_3 `ivs')
       (svy: reg protectAmer_3 `ivs') 
       (svy: reg fightabroad_3 `ivs') 
       (svy: reg prevent_UScit_3 `ivs') 
       (svy: reg prevent_forcit_3 `ivs'), reps(1000)  seed(2)
	   indepvars(disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust) 
;
#delimit cr
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )

matrix list `B_all'

svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.

gen num=_n
gen name="Ebola" if num<=5
replace name="Zika" if num>5
replace name="COVID (April 2020)" if num>10
replace name="COVID (July 2020)" if num>15
replace name="COVID (June 2022)" if num>20
gen outcome=""
foreach x of numlist 1(5)21 {
 replace outcome="Concern about outbreak" if num==`x'
 }
foreach x of numlist 2(5)22 {
 replace outcome="Government effort in US" if num==`x'
 }
foreach x of numlist 3(5)23 {
 replace outcome="Government effort abroad" if num==`x'
 }
foreach x of numlist 4(5)24 {
 replace outcome="Border policy - US citizens" if num==`x'
 }
foreach x of numlist 5(5)25 {
 replace outcome="Border policy - Foreign citizens" if num==`x'
 }
order name outcome pval rwpval

export delimited using "AppTableD1.txt", replace

************************************
* TABLE D2 - raw output

* PERSONAL BEHAVIORS

* disgust
set more off
use "Body_Politic_All_datasets.dta", clear
keep weight per* have* avoided* index* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]
local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg per_wash `ivs')
       (svy: reg per_cancel_travel `ivs') 
       (svy: reg per_stock_goods `ivs') 
       (svy: reg per_novisit `ivs') 
       (svy: reg per_stayhome `ivs') 
       (svy: reg per_nohospital `ivs')
       (svy: reg per_avoid_public `ivs') 
       (svy: reg per_work_home `ivs') 
       (svy: reg have_wornmask `ivs') 
       (svy: reg avoided_socwdist `ivs') 
       (svy: reg avoided_socwodist `ivs')
       (svy: reg avoided_travel `ivs') 
       (svy: reg have_wornmask3 `ivs') 
       (svy: reg have_vaccinated `ivs') 
       (svy: reg have_booster `ivs')
	   (svy: reg index_pers_1 `ivs')
	   (svy: reg index_pers_2r `ivs'),  reps(1000)  seed(2)
	   indepvars(disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust) 
;
#delimit cr
tempname B_all /*matrix for collecting results*/
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )
matrix list `B_all'
svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.
gen num=_n
save temp, replace
gen outcome=""
local n=1
local dvs "per_wash per_cancel_travel per_stock_goods per_novisit per_stayhome per_nohospital per_avoid_public per_work_home have_wornmask havenot_socwdist havenot_socwodist havenot_avoidedtravel have_wornmask2 have_vaccinated have_booster index_pers_1 index_pers_2r" 
foreach l of local dvs {
 replace outcome="`l'" if num==`n'
 local n=`n'+1
}
order outcome pval rw
rename pval disgust_pval
rename rwpval disgust_rwpval
sort num
save temp, replace

* party identification
set more off
use "Body_Politic_All_datasets.dta", clear
keep weight per* have* avoided* index* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]
local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg per_wash `ivs')
       (svy: reg per_cancel_travel `ivs') 
       (svy: reg per_stock_goods `ivs') 
       (svy: reg per_novisit `ivs') 
       (svy: reg per_stayhome `ivs') 
       (svy: reg per_nohospital `ivs')
       (svy: reg per_avoid_public `ivs') 
       (svy: reg per_work_home `ivs') 
	   (svy: reg index_pers_1 `ivs')
       (svy: reg have_wornmask `ivs') 
       (svy: reg avoided_socwdist `ivs') 
       (svy: reg avoided_socwodist `ivs')
       (svy: reg avoided_travel `ivs') 
	   (svy: reg index_pers_2r `ivs')	   
       (svy: reg have_wornmask3 `ivs') 
       (svy: reg have_vaccinated `ivs') 
       (svy: reg have_booster `ivs'),  reps(1000)  seed(2)
	   indepvars(pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR) 
;
#delimit cr
tempname B_all /*matrix for collecting results*/
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )
matrix list `B_all'
svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.
gen num=_n
rename pval pid_pval
rename rwpval pid_rwpval
sort num
merge 1:1 num using temp
drop _m
gen dv_type="personal behavior"
save temp_persbehavior, replace

***

* RELUCTANCE TO RETURN

set more off
use "Body_Politic_All_datasets.dta", clear
keep weight return* disc* index* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]
local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg return_restaurant_1 `ivs')
       (svy: reg return_sports_1 `ivs') 
       (svy: reg return_child_school_1 `ivs') 
       (svy: reg return_concert_1 `ivs') 
       (svy: reg return_fly_1 `ivs') 
       (svy: reg return_mall_1 `ivs') 
       (svy: reg return_transit_1 `ivs')
       (svy: reg return_movies_1 `ivs') 
       (svy: reg return_dinner_1 `ivs') 
       (svy: reg return_dentist_1 `ivs') 
       (svy: reg return_haircut_1 `ivs') 
       (svy: reg return_funeral_1 `ivs')
       (svy: reg return_wedding_1 `ivs') 
       (svy: reg return_church_1 `ivs') 
       (svy: reg return_school_self_1 `ivs') 
	   (svy: reg index_return_1 `ivs')
       (svy: reg disc_restaurant `ivs')
       (svy: reg disc_takeout `ivs')
       (svy: reg disc_grocerystore `ivs')
       (svy: reg disc_grocerydelivery `ivs')
       (svy: reg disc_friendsover `ivs')
       (svy: reg disc_bar `ivs')
       (svy: reg index_discomfort `ivs')
       (svy: reg return_restaurant_3 `ivs')
       (svy: reg return_sports_3 `ivs')
       (svy: reg return_concert_3 `ivs')
       (svy: reg return_fly_3 `ivs')
       (svy: reg return_mall_3 `ivs')
       (svy: reg return_transit_3 `ivs')
       (svy: reg return_movies_3 `ivs')
       (svy: reg return_dinner_3 `ivs')
       (svy: reg return_dentist_3 `ivs')
       (svy: reg return_haircut_3 `ivs')
       (svy: reg return_church_3 `ivs')
	   (svy: reg index_return_3 `ivs'),  reps(1000)  seed(2)
	   indepvars(disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust) 
;
#delimit cr
tempname B_all /*matrix for collecting results*/
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )
matrix list `B_all'
svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.
gen num=_n

gen outcome=""
local n=1
local dvs "return_restaurant_1 return_sports_1 return_child_school_1 return_concert_1 return_fly_1 return_mall_1 return_transit_1 return_movies_1 return_dinner_1 return_dentist_1 return_haircut_1 return_funeral_1 return_wedding_1 return_church_1 return_school_self_1 index_return_1 disc_restaurant disc_takeout disc_grocerystore disc_grocerydelivery disc_friendsover disc_bar index_discomfort return_restaurant_3 return_sports_3 return_concert_3  return_fly_3 return_mall_3 return_transit_3 return_movies_3 return_dinner_3 return_dentist_3 return_haircut_3 return_church_3 index_return_3"
foreach l of local dvs {
 replace outcome="`l'" if num==`n'
 local n=`n'+1
}
order outcome pval rw
rename pval disgust_pval
rename rwpval disgust_rwpval
sort num
save temp, replace

* party identification
set more off
use "Body_Politic_All_datasets.dta", clear
keep weight return* disc* index* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]
rename return_child_school_1 return_child_sch_1
rename return_school_self_1 return_self_sch_1
rename disc_grocerydelivery disc_grocerydeliv
local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg return_restaurant_1 `ivs')
       (svy: reg return_sports_1 `ivs') 
       (svy: reg return_child_sch_1 `ivs') 
       (svy: reg return_concert_1 `ivs') 
       (svy: reg return_fly_1 `ivs') 
       (svy: reg return_mall_1 `ivs') 
       (svy: reg return_transit_1 `ivs')
       (svy: reg return_movies_1 `ivs') 
       (svy: reg return_dinner_1 `ivs') 
       (svy: reg return_dentist_1 `ivs') 
       (svy: reg return_haircut_1 `ivs') 
       (svy: reg return_funeral_1 `ivs')
       (svy: reg return_wedding_1 `ivs') 
       (svy: reg return_church_1 `ivs') 
       (svy: reg return_self_sch_1 `ivs') 
	   (svy: reg index_return_1 `ivs')
       (svy: reg disc_restaurant `ivs')
       (svy: reg disc_takeout `ivs')
       (svy: reg disc_grocerystore `ivs')
       (svy: reg disc_grocerydeliv `ivs')
       (svy: reg disc_friendsover `ivs')
       (svy: reg disc_bar `ivs')
       (svy: reg index_discomfort `ivs')
       (svy: reg return_restaurant_3 `ivs')
       (svy: reg return_sports_3 `ivs')
       (svy: reg return_concert_3 `ivs')
       (svy: reg return_fly_3 `ivs')
       (svy: reg return_mall_3 `ivs')
       (svy: reg return_transit_3 `ivs')
       (svy: reg return_movies_3 `ivs')
       (svy: reg return_dinner_3 `ivs')
       (svy: reg return_dentist_3 `ivs')
       (svy: reg return_haircut_3 `ivs')
       (svy: reg return_church_3 `ivs')
	   (svy: reg index_return_3 `ivs'),  reps(1000)  seed(2)
	   indepvars(pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR) 
;
#delimit cr
tempname B_all /*matrix for collecting results*/
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )
matrix list `B_all'
svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.

gen num=_n
rename pval pid_pval
rename rwpval pid_rwpval
sort num
merge 1:1 num using temp
drop _m
gen dv_type="reluctance to return"
save temp_reluctance, replace

***

* POLICIES

* disgust
set more off
use "Body_Politic_All_datasets.dta", clear
keep weight loc* K12* masks* health* biz* index* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]
rename loc_restrict_noness_1 loc_restrict_trav_1
rename loc_restrict_noness_2 loc_restrict_trav_2
local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg loc_cancel_meet_1 `ivs')
       (svy: reg loc_close_biz_1 `ivs') 
       (svy: reg loc_close_schools_1 `ivs') 
       (svy: reg loc_work_home_1 `ivs') 
       (svy: reg loc_restrict_trav_1 `ivs') 
       (svy: reg loc_fevertest_1 `ivs')
       (svy: reg index_pol_1 `ivs')
       (svy: reg loc_cancel_meet_2 `ivs') 
       (svy: reg loc_close_biz_2 `ivs') 
       (svy: reg loc_close_schools_2 `ivs') 
       (svy: reg loc_work_home_2 `ivs') 
       (svy: reg loc_restrict_trav_2 `ivs')
       (svy: reg loc_fevertest_2 `ivs') 
       (svy: reg loc_req_mask_2 `ivs') 
       (svy: reg loc_quar_high_2 `ivs') 
	   (svy: reg index_pol_2 `ivs')
       (svy: reg K12masks `ivs')
       (svy: reg K12vax `ivs')
       (svy: reg masks_plane `ivs')
       (svy: reg health_vax `ivs')
       (svy: reg biz_vax `ivs')
	   (svy: reg index_pol_3 `ivs'),  reps(1000)  seed(2)
	   indepvars(disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust, disgust) 
;
#delimit cr
tempname B_all /*matrix for collecting results*/
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )
matrix list `B_all'
svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.

gen num=_n
gen outcome=""
local n=1
local dvs "loc_cancel_meet_1 loc_close_biz_1 loc_close_schools_1 loc_work_home_1 loc_restrict_noness_1 loc_fevertest_1 index_pol_1 loc_cancel_meet_2 loc_close_biz_2 loc_close_schools_2 loc_work_home_2 loc_restrict_noness_2 loc_fevertest_2 loc_req_mask_2 loc_quarantine_highstates_2 index_pol_2 covid_K12masks covid_k12vaccine covid_masks_plane covid_health_vaccine covid_biz_vaccine index_pol_3"
foreach l of local dvs {
 replace outcome="`l'" if num==`n'
 local n=`n'+1
}
order outcome pval rw
rename pval disgust_pval
rename rwpval disgust_rwpval
sort num
save temp, replace

* party identification

set more off
use "Body_Politic_All_datasets.dta", clear
keep weight loc* K12* masks* health* biz* index* disgust pid7catdR ideol female black hisp othrace age01
svyset [pweight=weight]
rename loc_restrict_noness_1 loc_restrict_trav_1
rename loc_restrict_noness_2 loc_restrict_trav_2
local ivs "disgust pid7catdR ideol female black hisp othrace age01"
#delimit ;
rwolf2 (svy: reg loc_cancel_meet_1 `ivs')
       (svy: reg loc_close_biz_1 `ivs') 
       (svy: reg loc_close_schools_1 `ivs') 
       (svy: reg loc_work_home_1 `ivs') 
       (svy: reg loc_restrict_trav_1 `ivs') 
       (svy: reg loc_fevertest_1 `ivs')
       (svy: reg index_pol_1 `ivs')
       (svy: reg loc_cancel_meet_2 `ivs') 
       (svy: reg loc_close_biz_2 `ivs') 
       (svy: reg loc_close_schools_2 `ivs') 
       (svy: reg loc_work_home_2 `ivs') 
       (svy: reg loc_restrict_trav_2 `ivs')
       (svy: reg loc_fevertest_2 `ivs') 
       (svy: reg loc_req_mask_2 `ivs') 
       (svy: reg loc_quar_high_2 `ivs') 
	   (svy: reg index_pol_2 `ivs')
       (svy: reg K12masks `ivs')
       (svy: reg K12vax `ivs')
       (svy: reg masks_plane `ivs')
       (svy: reg health_vax `ivs')
       (svy: reg biz_vax `ivs')
	   (svy: reg index_pol_3 `ivs'),  reps(1000)  seed(2)
	   indepvars(pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR, pid7catdR) 
;
#delimit cr
tempname B_all /*matrix for collecting results*/
matrix b=e(RW)
matrix `B_all' = ( nullmat(`B_all') \ b )
matrix list `B_all'
svmat `B_all', names(output)
keep output1 output3 /*original p-values and Romano-Wolf p-values*/
rename output1 pval
rename output3 rwpval
drop if pval==.
gen num=_n
rename pval pid_pval
rename rwpval pid_rwpval
sort num
merge 1:1 num using temp
drop _m
gen dv_type="policy support"
save temp_policy, replace

* COMBINE RESULTS ACROSS TYPES OF DVS and MAKE TABLE D2
use temp_persbehavior, clear
append using temp_reluctance
append using temp_policy

* n of outcomes by type
bysort dv_type: egen n_outcomes=max(num)

* comparison of disgust p-values
gen disgust1=1 if disgust_pval<.05 & disgust_rwpval<.05
gen disgust2=1 if disgust_pval>.05 & disgust_rwpval>.05
gen disgust3=1 if disgust_pval<.05 & disgust_rwpval>.05

* comparison of pid p-values
gen pid1=1 if pid_pval<.05 & pid_rwpval<.05
gen pid2=1 if pid_pval>.05 & pid_rwpval>.05
gen pid3=1 if pid_pval<.05 & pid_rwpval>.05

collapse (mean) n_outcomes (sum) disgust1-pid3, by(dv_type)
xpose, clear v
drop in 1
rename v1 personal_behaviors
rename v2 policy_support
rename v3 reluctance_to_return
order _v pers reluc policy
replace _v="Disgust - both p<.05" if _v=="disgust1"
replace _v="Disgust - neither p<.05" if _v=="disgust2"
replace _v="Disgust - original p<.05, adjusted p>.05" if _v=="disgust3"
replace _v="PID - both p<.05" if _v=="pid1"
replace _v="PID - neither p<.05" if _v=="pid2"
replace _v="PID - original p<.05, adjusted p>.05" if _v=="pid3"

export delimited using "AppTableD2.txt", replace

log close 
